Skip to content

Conversation

@lasagna0
Copy link

@lasagna0 lasagna0 commented Sep 11, 2025

Description

The current error message when validating cosmosdb_connection_string is misleading.
In the previous version it stated:

"CosmosDB connection string CAN BE EMPTY"

when in fact the correct behavior is that it cannot be empty.

This PR updates the ValueError to properly reflect the restriction.

Changes

self._validate_enum_value(kind, CosmosDBVectorSearchType)

if not cosmosdb_connection_string:
    raise ValueError("CosmosDB connection string can't be empty.")

self.cosmosdb_connection_string = cosmosdb_connection_string
self.cosmosdb_client = cosmosdb_client

Expected Behavior

When the cosmosdb_connection_string parameter is empty, the following clear error is raised:

ValueError: CosmosDB connection string can't be empty.

The error printed in this script when there is an empty cosmosDB connection string it´s confusing. In the later version says "CosmosDB string CAN BE EMPTY" while the true error is CANT
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant